package oop.ex2.expression;

import oop.ex2.exceptions.UnrecognizedVariable;

/**
 * Implements the multiplication operator.
 * @author daniel
 */
public class MulOpNode extends BinaryOpNode {

	/**
	 * Build a binary operator using the matched string.
	 * @param matchedString The matched string that generated this node.
	 */
	public MulOpNode(String matchedString) {
		super(matchedString);
	}

	@Override
	public double calculateNode() throws UnrecognizedVariable {
		//return the multiple of the two children
		return _children.get(0).calculateNode() * _children.get(1).calculateNode();
	}

}
